package junit;

/**
 * Created by IntelliJ IDEA.
 * User: Admin
 * Date: 11.05.11
 * Time: 13:47
 * To change this template use File | Settings | File Templates.
 */
public class Component implements ITestable {

	private final Container container = new Container();

	public void init() {
		container.int_val *=-1;
		container.long_val *=-1;
		container.string_val = String.valueOf(container.int_val);
	}

	public int getValue() {
		return container.int_val;
	}

	public Container build() {
		return container;
	}

	public void save(Container container) {
		this.container.int_val = container.int_val;
		this.container.long_val = container.long_val;
		this.container.string_val = container.string_val;
		container.setDefault();
	}

	public void flush() {
		container.setDefault();
	}

	public void close() {
		System.out.println("Component closed");
	}
}
